<div>
    <h3 class="header smaller lighter blue">
        <span>Proxy-Ping-Stats</span>
    </h3>
    <div>
        <ul class="nav nav-tabs padding-18 tab-size-bigger" ng-if="dcs && dcs.length">
            <li ng-repeat="dc in dcs" ng-class="{'active': currentDcId == dc.dcName}">
                <a ng-click="switchDc(dc)" data-toggle="tab">
                    {{dc.dcName}}
                </a>
            </li>
        </ul>

        <div ng-if="dcs && dcs.length">
            <div class="col-xs-12">
                <div class="panel panel-primary" style="margin-top: 15px;" ng-repeat="proxyCollector in collectors">
                    <header class="panel-heading">
                        <div class="row">
                            <div class="col-md-6">源Proxy: {{proxyCollector.proxyInfo.hostPort.host}}</div>
                            <div class="col-md-6 text-right">
                                <a class="btn btn-primary btn-sm" ui-sref="proxy_tunnels({proxyIp: proxyCollector.proxyInfo.hostPort.host, dcId: currentDcId})">Proxy-Detail</a>
                            </div>
                        </div>
                        </header>

                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>直接Ping的地址</th>
                            <th>目标实际地址(考虑NAT情况下)</th>
                            <th>开始时间</th>
                            <th>结束时间</th>
                            <th>总耗时(ms)</th>
                            <th>历史信息打点</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="pingStatsResult in proxyCollector.pingStatsResults">

                            <td ng-bind="prettyJson(pingStatsResult.direct)"></td>
                            <td ng-bind="prettyJson(pingStatsResult.real)"></td>
                            <td>{{pingStatsResult.start | date:'yyyy-MM-dd HH:mm:ss:sss'}}</td>
                            <td>{{pingStatsResult.end | date:'yyyy-MM-dd HH:mm:ss:sss'}}</td>
                            <td>{{pingStatsResult.end - pingStatsResult.start}}</td>
                            <td><span class="hickwall" aria-hidden="true" ng-click="gotoProxyPingHickwall()"></span></td>
                           </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</div>

